package demo;

import java.util.Arrays;

public class MaoPaoSort {
    public static void main(String[] args) {
        int[] n = new int[]{32,54,21,65,35,87,58,43};
        for (int i = 0; i < n.length-1 ; i++) {
            for (int j = 0; j < n.length-i-1; j++) {
                if(n[j] > n[j+1]){
                    int temp = n[j];
                    n[j] = n[j+1];
                    n[j+1] = temp;
                }
            }
        }
        System.out.println(Arrays.toString(n));
    }
}
